package com.example.beanlife;

import com.example.beanlife.bean.Vip;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * ClassName:testVip
 * Package:com.example.beanlife
 * Description:
 *
 * @Author:ZhangXin
 * @Create:2023/5/9-9:34
 * @Version:v1.0
 */
public class testVip {
    @Test
    public void testVip() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring-vip.xml");
        Vip vip = applicationContext.getBean("vip", Vip.class);
        System.out.println("第六步:Bean的使用=>"+vip);

        ClassPathXmlApplicationContext context = (ClassPathXmlApplicationContext) applicationContext;
        context.close();
    }
}
